<template>
  <div>
    <el-dialog
      title="点位详情"
      :visible="viewVisible"
      width="60%"
      @close="close"
    >
      <el-form>

        <el-form-item>
          <el-table
            :data="list"
            style="width: 95%"
            :border="false"
          >
            <el-table-column
              type="index"
              label="序号"
            />
            <el-table-column
              prop="innerCode"
              label="机器编码"
            />
            <el-table-column
              prop="vmStatus"
              label="设备状态"
              :formatter="checkstatus"
            />
            <el-table-column
              prop="lastSupplyTime"
              label="最后一次供货时间"
            >
              <template slot-scope="{row}">
                {{ row.lastSupplyTime | formatDate }}
              </template>
            </el-table-column>
          </el-table>

        </el-form-item></el-form>

    </el-dialog>
  </div>
</template>

<script>
import Type from '@/components/constant/employees'
export default {
  props: {
    viewVisible: {
      type: Boolean,
      required: true,
      default: false
    }, list: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
      hireType: Type.hireType
    }
  },

  created() {

  },
  methods: {
    close() {
      this.$parent.viewVisible = false
    },
    checkstatus(row, cloumn, cellValue) {
      const res = this.hireType.find(item => item.id === cellValue)
      return res.value
    }

  }
}

</script>

<style lang='scss'>

.el-table__header{
.is-leaf{
 background-color: #f3f6fb;

}
}
</style>
